home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2892 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: hai.hiMolde.no!espen
  2. From: espen@hai.hiMolde.no (Espen Berntsen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: SAS-C and Interrupts
  5. Date: 6 Feb 1996 18:47:35 GMT
  6. Organization: Molde College, Department of Computer Science
  7. Message-ID: <4f87o7$p1a@ulke.hiMolde.no>
  8. NNTP-Posting-Host: hai.himolde.no
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. How do you call a C routine from an interrupt in sas-c??
  12.  
  13.  
  14. Whenever I try to do it, the machine locks up.
  15.  
  16. the C routine looks like this:
  17.  
  18. ----- cut ---
  19. LONG Counter = 0;
  20.  
  21. void VBLRoutine(void)
  22. {
  23.     Counter++;
  24. }
  25. ----- cut -----
  26.  
  27. and the assembly vertical blank interrupt like this :
  28.  
  29. ----- cut -----
  30. ; some includes, don't remember precicely
  31.  
  32.     XDEF _VBLRoutine
  33. VertBlankServer
  34.     jsr _VBLRoutine
  35.     moveq    #0,d0
  36.     rts
  37. ----- cut -----
  38.  
  39. Now, when I don't call the C routine, but increase the Counter by using 
  40. (a1), everything is fine. But when I call the C routine. the machine just 
  41. locks.
  42.  
  43. Now, the VBL is not supposed to just add a counter, it is just a test :-)
  44.  
  45. --
  46.  
  47. Espen.Berntsen@hiMolde.no  <> irc: Nameless <> http://www.himolde.no/~espen
  48. ===========================================================================
  49. Fighting for peace is like fucking for virginity.
  50.